package com.antfin.exam.bonus.controller;

import com.antfin.exam.bonus.service.BonusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/bonus")
public class BonusController {
    @Autowired
    BonusService bonusService;


    @PostMapping(path = "/{userId}/take-bonus-score/{bonusScoreId}")
    public int takeBonusScore(
            @PathVariable("userId") String userId
            , @PathVariable("bonusScoreId") String bonusScoreId
            , @RequestParam("score") int score) {
        return bonusService.takeBonusScore(userId, bonusScoreId, score);
    }
}
